<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-nested" prefix="nested" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ page contentType="text/html; charset=utf-8"  import="com.leexuan.ordersystem.beans.*" import="com.leexuan.ordersystem.db.*" import="java.util.*"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">

<HTML xmlns="http://www.w3.org/1999/xhtml">
<HEAD>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<LINK 
href="css/admincp.css" type=text/css rel=stylesheet>
</HEAD>
<html:base/>
<BODY topMargin=10>

<%

SortDB db = new SortDB();
db.getConnection();

ArrayList arraylist =new ArrayList();
arraylist = db.getSorts();
int sortnum = arraylist.size();

db.closeConnection();

//////////////////////////////////////

ProductDB pdb = new ProductDB();
pdb.getConnection();

arraylist = pdb.getProducts();
int productnum = arraylist.size();

pdb.closeConnection();

//////////////////////////////////////


CustomerDB cdb = new CustomerDB();
cdb.getConnection();

arraylist = cdb.getCustomers();
int customernum = arraylist.size();

cdb.closeConnection();

//////////////////////////////////////



AdminDB adb = new AdminDB();
adb.getConnection();

arraylist = adb.getAdmins();
int adminnum = arraylist.size();

adb.closeConnection();

//////////////////////////////////////




InvoiceDB idb = new InvoiceDB();
idb.getConnection();

arraylist = idb.getInvoices();
int invoicenum = arraylist.size();

arraylist = idb.getInvoicesEmpty();
int invoicenumnotfull = arraylist.size();

idb.closeConnection();

//////////////////////////////////////
OrderDB odb = new OrderDB();
odb.getConnection();

arraylist = odb.getOrders();
int ordernum = arraylist.size();

arraylist = odb.getOrdersNotFull();
int ordernumnotfull = arraylist.size();

odb.closeConnection();

//////////////////////////////////////
Admin admin = (Admin)session.getAttribute("admin");
String aname="";
if(arraylist !=null){
	aname = admin.getName();
}
%>

<TABLE cellSpacing=6 cellPadding=2 width="100%" border=0>
  <TBODY>
  <TR>
    <TD>
      <TABLE class=guide cellSpacing=0 cellPadding=0 width="100%" border=0>
        <TBODY>
        <TR> 
          <TD>系统首页</TD></TR></TBODY></TABLE>
          
			<br>
			<table width="100%" border="0" cellpadding="0" cellspacing="0"
				class="tableborder">
				<tr class="header">
					<td>欢迎登陆</td>
				</tr>
				<tr>
					<td>
					<ul>
						<li>你好：<%=aname %> 
						<li>当前系统时间：
						
<script type="text/javascript">

var myDate = new Date(); 

document.write( myDate.getFullYear()+"年"+(myDate.getMonth()+1)+"月"+myDate.getDate()+"日 "+myDate.getHours()+":"+myDate.getMinutes()+":"+myDate.getSeconds());

</script> 						
					</ul>
					</td>
				</tr>
			</table>
			          
			<br>
			<table width="100%" border="0" cellpadding="0" cellspacing="0"
				class="tableborder">
				<tr class="header">
					<td colspan=2>系统提示</td>
				</tr>
				<tr>
					<td style="color:#FF0000" width="80%">
					<ul>
					<%if(invoicenumnotfull>0){ %>
						<li>提示：有 <b><%=invoicenumnotfull%></b> 张未到款发票，请尽快入账！&nbsp;&nbsp;<a href="listInvoiceEmpty.do">发票入账</a>
					<%} %>	
					<%if(ordernumnotfull>0){ %>
						<li>提示：有 <b><%=ordernumnotfull%></b> 张订单还没全部发货，请尽快发货！ &nbsp;&nbsp;<a href="listOrderNotFull.do">产品发货</a>
					<%} %>
					
					<%if(ordernumnotfull==0&&invoicenumnotfull==0){ %>
						<li>暂时无提示！ 
					<%} %>					
					</ul>
					</td>
					<td>
					 <br>
					
					</td>
					
				</tr>
				
			</table>
			<br>

			<table width="100%" border="0" cellpadding="0" cellspacing="0"
				class="tableborder">
				<tr class="header">
					<td colspan="3">系统信息</td>
				</tr>
				<tr class="altbg1">
					<td width="25%">总客户数</td>
					<td width="10%"><%=customernum %> 家</td>
					<td><a href="listCustomer.do">查看详情</a></td>
				</tr>
				<tr class="altbg2">
					<td width="25%">总订单数</td>
					<td><%=ordernum %> 张</td>
					<td><a href="listOrder.do">查看详情</a></td>					
				</tr>
				<tr class="altbg1">
					<td>总发票数</td>
					<td><%=invoicenum %> 张</td>
					<td><a href="listInvoice.do">查看详情</a></td>					
				</tr>				
				<tr class="altbg2">
					<td>产品分类数</td>
					<td><%=sortnum %> 种</td>
					<td><a href="listSort.do">查看详情</a></td>					
				</tr>
				<tr class="altbg1">
					<td>总产品数</td>
					<td><%=productnum %> 种</td>
					<td><a href="listProduct.do">查看详情</a></td>					
				</tr>					
				<tr class="altbg2">
					<td>工作人员数</td>
					<td><%=adminnum %> 人</td>
					<td><a href="listAdmin.do">查看详情</a></td>					
				</tr>
			</table>
			<BR><BR>
<DIV class=footer>
<HR width="80%" color=#86b9d6 noShade SIZE=0>
Developed By Leexuan &nbsp; 2007 &nbsp;<A style="COLOR: #000" href="http://wwww.leexuan.com/" 
      target="_blank">Blog: www.leexuan.com</A></DIV><BR></BODY></HTML>
